package com.example.everying.service.user.impl;/*
 * 项目名称: everything
 * 文件名: InviteRecordsServiceImpl
 * 作者: 张泽阳
 * 日期: 2025/5/26
 * 描述:
 */

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.everying.mapper.invite.InviteRecordsMapper;
import com.example.everying.model.entity.invite.InviteRecordsEntity;
import com.example.everying.service.user.InviteRecordsService;
import org.springframework.stereotype.Service;

@Service
public class InviteRecordsServiceImpl extends ServiceImpl<InviteRecordsMapper, InviteRecordsEntity> implements InviteRecordsService {
    @Override
    public InviteRecordsEntity getRecordByInviteeId(String inviteeId) {
        LambdaQueryWrapper<InviteRecordsEntity> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(InviteRecordsEntity::getInviteeId, inviteeId);

        return getOne(queryWrapper);
    }

    @Override
    public InviteRecordsEntity getRecordByInviteeOpenId(String openId) {
        LambdaQueryWrapper<InviteRecordsEntity> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(InviteRecordsEntity::getInviteeOpenid, openId);
        return getOne(queryWrapper);
    }
}
